package com.zbf.config;

import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.cloud.context.config.annotation.RefreshScope;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.jdbc.datasource.DriverManagerDataSource;

import javax.sql.DataSource;

/**
 * @author: LCG
 * 作者: LCG
 * 日期: 2021/6/26  10:39
 * 描述:
 */
@Configuration
public class MyDataSourceConfig {


    @Bean
    @ConfigurationProperties(prefix = "lcg.datasource")
    @RefreshScope
    public DataSource getDataSource(){
       return new DriverManagerDataSource();
    }

}
